﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ExternalConnections.EndpointWrapper
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll


namespace DnProcessSimulateCommands.ExternalConnections;

internal class EndpointWrapper
{
  private string m_endPointName;
  private string m_endPointUrl;

  internal EndpointWrapper(string endPointName, string endPointUrl)
  {
    this.m_endPointName = endPointName;
    this.m_endPointUrl = endPointUrl;
  }

  internal string endPointUrl => this.m_endPointUrl;

  internal string endPointName => this.m_endPointName;

  internal string Endpoint => this.EndPoint();

  private string EndPoint()
  {
    string str = string.Empty;
    if (this.endPointName != null && !this.endPointName.Equals(""))
      str = this.m_endPointName + " [" + this.m_endPointUrl + "]";
    return str;
  }

  public override string ToString()
  {
    string str = string.Empty;
    if (this.endPointName != null && !this.endPointName.Equals(""))
      str = this.m_endPointName + " [" + this.m_endPointUrl + "]";
    return str;
  }

  public override bool Equals(object obj)
  {
    if (obj == null || this.GetType() != obj.GetType())
      return false;
    EndpointWrapper endpointWrapper = (EndpointWrapper) obj;
    return this.m_endPointName == endpointWrapper.m_endPointName && this.m_endPointUrl == endpointWrapper.m_endPointUrl;
  }

  public override int GetHashCode() => this.m_endPointUrl.GetHashCode();
}
